A Correct Abstract Machine for the Stochastic Pi-calculus

نویسندگان

  • Andrew Phillips
  • Luca Cardelli
چکیده

Machine for Stochastic Pi-Calculus (SPiM) ➢ Formalise how the simulator works (program specification). ➢ Prove properties about the simulator (program verification). ➢ Give greater confidence in the simulation results. ➢ Improve on existing simulators (BioSpi). Andrew Phillips BioConcur 2004 19 Machine Data Structures ➢ General Machine Term: νn1 νn2 ...νnN (Σ1 ::Σ2 :: ... ::ΣM :: []) ➢ Syntax Definition: V,U ::= νn V Restriction p A List A,B ::= [] Empty p Σ::A Summation Andrew Phillips BioConcur 2004 20 Machine Encoding ➢ Encoding (P ): (P ) , P ◦ [] ➢ Construction (P ◦ V ): n 6∈ fn(P ) ⇒ P ◦ (νn V ) , νn (P ◦ V ) 0 ◦A , A (P | Q) ◦A , P ◦Q ◦A n 6∈ fn(P ◦A) ⇒ (νm P ) ◦A , νn (P{n/m} ◦A) !π.P ◦A , (π.(P | !π.P ) + 0) ◦A (π.P + Σ) ◦A , (π.P + Σ)::A Andrew Phillips BioConcur 2004 21 Machine Execution ➢ Reduction (V r −→ V ′): V r −→ V ′ ⇒ νx V r −→ νx V ′ ∣∣∣∣∣ x = Next(A) ∧A Â (x(m).P + Σ)::A′ ∧A′ Â (x〈n〉.Q + Σ′) ::A′′ ⇒ A rate(x) −→ P{n/m} ◦Q ◦A′′ ➢ Selection (A Â B): A Â A A Â Σ′ ::A′ ⇒ Σ::A Â Σ′ ::Σ::A′ Σ::A Â (π′.P ′ + Σ′) ::A ⇒ (π.P + Σ) :: A Â (π′.P ′ + π.P + Σ′) ::A Andrew Phillips BioConcur 2004 22 Channel Activity ➢ Choose next channel x = Next(A) by stochastic algorithm [Gillespie, 1977] ➢ Gillespie chooses next channel based on activity : activity = number of possible interactions on a channel ➢ In SPiM, activity of channel x in term A: Actx(A) = (Inx(A) ∗Outx(A))−Mixx(A) ❑ Inx(A) = number of unguarded inputs on channel x in A. ❑ Outx(A) = number of unguarded outputs on channel x in A. ❑ Mixx(A) = sum of Inx(Σi)×Outx(Σi) for each summation Σi in A. Andrew Phillips BioConcur 2004 23 Gillespie: Choosing the Next Reaction Next(A) 1. For all x ∈ fn(A) calculate ax = Actx(A) ∗ rate(x) 2. Store non-zero values of ax in a list (xμ, aμ), where μ ∈ 1...M . 3. Calculate a0 = ∑M ν=0 aν 4. Generate two random numbers n1,n2 ∈ [0, 1] and calculate τ, μ such that: τ = (1/a0) ln(1/n1) μ−1 ∑ ν=1 aν < n2a0 ≤ μ ∑ ν=1 aν 5. Next(A) = xμ and Delay(A) = τ . Andrew Phillips BioConcur 2004 24 Correctness of the Machine ➢ Safety : no runtime errors (no crashes) Lemma 1. ∀V.V ∈ SPiM ∧ V r −→ V ′ ⇒ V ′ ∈ SPiM ➢ Soundness: machine only performs valid executions steps (behaves well) Theorem 1. ∀V.V ∈ SPiM ∧ V r −→ V ′ ⇒ [V ] r −→ [V ′] ➢ Completeness: machine can perform all execution steps of the calculus Theorem 2. ∀P.P ∈ SPi ∧ P r −→ P ′ ⇒ (P ) r −→≡ (P ′). ➢ Termination: machine does not loop forever unnecessarily Theorem 3. ∀P.P ∈ SPi ∧ P 6−→ ⇒ (P ) 6−→ Andrew Phillips BioConcur 2004 25 Correctness of the Machine ➢ Duration: reactions in machine and calculus have same average duration ❑ Gillespie algorithm proved correct for selecting next reaction channel. ❑ Also need to ensure that reaction has correct duration ❑ E.g. reduction in P1 is twice as fast as reduction in P2: P1 , xr〈n〉.P + xr〈n〉.P | x(m).Q P2 , xr〈n〉.P | x(m).Q ❑ Sufficient to ensure that machine and calculus have same channel activity. Proposition 1. ∀V ∈ SPiM.Actx(V ) = Actx([V ]) Proposition 2. ∀P ∈ SPi.Actx(P ) = Actx((P )) Andrew Phillips BioConcur 2004 26 Implementation ➢ Abstract Machine maps almost directly to program code ➢ Implemented a polymorphic type system and type checker ➢ Correctness of the machine gives greater confidence in the simulation results ➢ Demo... Andrew Phillips BioConcur 2004 27 Conclusion➢ Presented a graphical representation for pi-calculus:❑ Precise, compositional, executable descriptions.❑ Used to model regulatory systems at the molecular level.➢ Presented an abstract machine for the stochastic pi-calculus:❑ Correctness proof: safety, soundness, completeness, termination, duration.❑ Maps readily to program code.❑ Could be used as a basis for implementing new calculi.➢ Built a simulator based on the machine.❑ Plan to incorporate a graphical editor as a front-end.Andrew Phillips BioConcur 200428 References[Gillespie, 1977] Gillespie, D. T. (1977). Exact stochastic simulation of coupledchemical reactions. J. Phys. Chem., 81(25):2340–2361.[Priami et al., 2001] Priami, C., Regev, A., Shapiro, E., and Silverman, W.(2001). Application of a stochastic name-passing calculus to representationand simulation of molecular processes. Information Processing Letters. in press. Andrew Phillips BioConcur 200429 Link Encoding➢ Encoding uses restriction, replication, parallel composition and communication.➢ A linked node → a replicated input on a fresh channel x, in parallel with anoutput on x➢ A link to the node → an output on x.➢ E.g.:ΣΣππ’’=ΣΣππ’’new x!x() x<>x<> Andrew Phillips BioConcur 200430 Safety ProofLemma 2. ∀V.V ∈ SPiM ∧ Vr−→ V ′ ⇒ V ′ ∈ SPiMProof. By Lemma 3, Lemma 4 and by induction on reduction in SPiM. 2Lemma 3. ∀A ∈ SPiM.A Â B ⇒ B ∈ SPiMProof. By induction on selection in SPiM. 2Lemma 4. ∀V.∀P.V ∈ SPiM ∧ P ∈ SPi ⇒ P ◦ V ∈ SPiMProof. By induction on construction in SPiM. 2 Andrew Phillips BioConcur 200431 Soundness ProofTheorem 4. ∀V.V ∈ SPiM ∧ Vr−→ V ′ ⇒ [V ] r−→ [V ′]Proof. By Lemma 5, Lemma 6 and by induction on reduction in SPiM. 2Lemma 5. ∀A.A ∈ SPiM ∧A Â B ⇒ [A] ≡ [B]Proof. By induction on selection in SPiM. 2Lemma 6. ∀V.∀P.V ∈ SPiM ∧ P ∈ SPi ⇒ [P ◦ V ] ≡ P | [V ]Proof. By induction on construction in SPiM. 2[νn V ] , νn [V ][[]] , 0[Σ::A] , Σ | [A]Andrew Phillips BioConcur 200432 Completeness ProofTheorem 5. ∀P.P ∈ SPi ∧ Pr−→ P ′ ⇒ (P ) r−→≡ (P ′).Proof. By Lemma 7 and by induction on reduction in SPi, where the rule forparallel composition is expanded over the remaining rules. 2Lemma 7. P ≡ Q ⇒ (P ) ≡ (Q)Proof. By induction on structural congruence in SPi. 2Lemma 8. ∀V.V ∈ SPiM∧U ≡ V ∧V r−→ V ′ ⇒ ∃U ′.U r−→ U ′∧U ′ ≡V ′Proof. By induction on structural congruence in SPiM. 2 Andrew Phillips BioConcur 200433 Structural CongruenceV≡α U ⇒ V ≡ Ux 6∈ fn(V ) ⇒ νx V ≡ Vνx νy V ≡ νy νx VΣ::Σ′ ::A ≡ Σ′ ::Σ::AA ≡ A′ ⇒ Σ::A ≡ Σ::A′(π.P + π′.P ′ + Σ)::A ≡ (π′.P ′ + π.P + Σ)::AΣ::A ≡ Σ′ ::A ⇒ (π.P + Σ)::A ≡ (π.P + Σ′) ::AAndrew Phillips BioConcur 200434 Termination ProofTheorem 6. ∀P.P ∈ SPi ∧ P 6−→ ⇒ (P ) 6−→Proof. By Theorem 4 and by basic relationships between encoding and decod-ing. 2 Andrew Phillips BioConcur 200435 Graphical SemanticsxPx(m)P’’ xPx(m)P’’xPx(m)P’xPx(m)P’ΣΣ!Σ!!Σ! ➢ Requires some imagination: for substituting names and for cloning graphs.Andrew Phillips BioConcur 200436

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Efficient, Correct Abstract Machines for Stochastic Process Calculi with Mobile Compartments

This paper describes a general approach for deriving efficient, correct abstract machines for stochastic process calculi with nested mobile compartments. The approach is applied to the Bioambient calculus and the Brane calculus. Interestingly, the abstract machines for both calculi can be defined from a common machine that supports both sets of synchronisation primitives. This illustrates the f...

متن کامل

An Abstract Machine for the Stochastic Bioambient calculus

This paper presents an abstract machine for the stochastic bioambient calculus. The abstract machine is proved sound and complete with respect to a novel stochastic semantics, and is also shown to preserve the reduction probabilities of the calculus. The machine is implemented as an extension to an existing simulator for stochastic pi-calculus.

متن کامل

Stochastic simulation of multiple process calculi for biology

Numerous programming languages based on process calculi have been developed for biological modelling, many of which can generate potentially unbounded numbers of molecular species and reactions. As a result, such languages cannot rely on standard reaction-based simulation methods, and are generally implemented using custom stochastic simulation algorithms. As an alternative, this paper proposes...

متن کامل

EPTCS Proceedings of the Fourth Workshop on Membrane Computing and Biologically Inspired Process Calculi 2010

Biological systems typically involve large numbers of components with complex, highly parallel interactions and intrinsic stochasticity. Numerous programming languages have been developed for modelling such systems, many of which are based on process calculi. Most of these calculi, particularly those involving membrane interactions, are expressive enough to generate potentially unbounded number...

متن کامل

Coupled Chemical Reactions in Stochastic Pi-calculus

This document describes how a number of spatially homogeneous chemical systems can be modeled in the stochastic pi-calculus and simulated using the Stochastic Pi Machine. Each of the systems presented here was previously defined as a set of reaction equations, which were simulated using the Gillespie algorithm. For further details on the models and the references to the original literature, see...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2004